﻿//********************************************************************
// 
//  file:  FileManager.cs
//  Diomede Service FileManager Object
//
//  (C) Copyright 2010, Diomede Corporation
//  All rights reserved
// 
//  Use, modification, and distribution is subject to   
//  the New BSD License (See accompanying file license.txt).
// 
//********************************************************************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Diomede.SDK;
using data.diomedestorage.com;
using System.Windows.Forms;

namespace Diomede.Explorer
{

    public class FileManager
    {
        public ISession Session { get; set; }
        public List<MetaData> GetAllFolders()
        {
            if (Session == null)
            {
                throw new Exception("No valid session");
            }
            IFileManagement f = Session as IFileManagement;
            IGetMetaDataExecResult result = f.GetMetaData(null, "SourceRelativePath", string.Empty);
            if (result.Status == Diomede.SDK.Enums.ExecutionResults.Success)
            {
                return result.MetaData;
            }
            else
                return null;

        }

       
    }

    public class FolderNode : TreeNode
    {
        public MetaData MetaData { get; set; }
    }

}
